//
//  WebViewController.swift
//  fansarea
//
//  Created by 张 on 2018/5/3.
//  Copyright © 2018年 张. All rights reserved.

//uiwebview 的使用
//

import UIKit
import WebKit

class WebViewController: UIViewController {

    @IBOutlet weak var webView: UIWebView!
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        webView.isHidden = true
        
        let wkWebview = WKWebView(frame: view.frame)
        view.addSubview(wkWebview)
        //高度自使用
        wkWebview.autoresizingMask = [.flexibleHeight]
        // Do any additional setup after loading the view.
        if let url = URL(string: "http://xiaoboswift.com"){
            let request = URLRequest(url: url)
       // webView.loadRequest(request)
            wkWebview.load(request)
        }
        
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
